namespace AF.Models
{
    /// <summary>
    /// 交易记录模型
    /// </summary>
    public class Transaction
    {
        public int Id { get; set; }
        
        public TransactionType Type { get; set; }
        
        public decimal Amount { get; set; }
        
        public int CategoryId { get; set; }
        
        public string CategoryName { get; set; } = string.Empty;
        
        /// <summary>
        /// 关联的项目ID（可选）
        /// </summary>
        public int? ProjectId { get; set; }
        
        /// <summary>
        /// 项目名称（冗余字段，便于显示）
        /// </summary>
        public string? ProjectName { get; set; }
        
        public string Description { get; set; } = string.Empty;
        
        public DateTime Date { get; set; }
        
        public DateTime CreatedAt { get; set; }
        
        public DateTime? UpdatedAt { get; set; }
        
        public string? Remark { get; set; }
    }
}

